Release 10.1A: OpenEdge Getting Started:
New and Revised Features


Views technique

When using native views defined in your foreign data source, you can generate a record format that serves as a 4GL buffer to retrieve database results for a RUN STORD-PROC statement. The buffer definition allows access to individual columns of the result set without having to parse the results. Unlike the proc-text-buffer and LOAD-RESULT-INTO techniques, the native view technique requires view administration on the foreign data source. Therefore, you must balance the capabilities of native views against the goals you have for your data.

Review the example presented in Figure 2–3.

RUN STORED-PROC send-sql-statement 
     (“SELECT name, address, city, state, postal_code FROM customer WHERE 
     credit_limit>=500”). 
FOR EACH cust-results: 
     DISPLAY cust-results.name. 
END. 

Figure 2–3: Views technique example

To process the results of the send-sql-statement presented in Figure 2–3, you must create a view, _BUFFER_cust-results, before you run the statement. Figure 2–4 shows the SQL SELECT statement contained within this view’s definition.

SELECT name, address, city, state, postal_code FROM customer WHERE 1=0 

Figure 2–4: SQL statement inside the native view

Figure 2–3 and Figure 2–4 illustrate that using the view technique requires up front planning and management to successfully implement.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095